package com.kfm.base.reflect;

public class CamelCaseTest {

    public static void main(String[] args) {
        String columnName = "hello_world_zzzz";
        if (columnName.contains("_")){
            // 有多个单词组成，转换为驼峰命名  is_marry
            String[] split = columnName.split("_");
            StringBuilder sb = new StringBuilder(split[0]);
            for (int i = 1; i < split.length; i++) {
                String s = split[i];
                sb.append(s.substring(0, 1).toUpperCase()).append(s.substring(1).toLowerCase());
            }

            System.out.println(sb.toString());
        }
    }
}
